package com.asdf.application.commands;

import java.util.List;

import com.asdf.application.Constants;
import com.asdf.external.INetserviceSimulator;
import com.asdf.external.LogWriter;

/**
 * @author Artem Barger
 * 
 * Command which capable to switch airports.
 *
 */
public class SwitchCommand implements ICommandLine
{

	@Override
	public void execute( INetserviceSimulator simulator, List<String> parameters)
	{
		if ( parameters.size( ) != 2)
		{
			LogWriter.getInstance( ).reportWarning( Constants.UNABLE_TO_SWITCH_MSG);
			return;
		}
		simulator.switchAirport( parameters.get( 1));
	}

}
